package cn.mifengkong.appcommon.liveness.utils;

import android.content.Context;
import android.util.DisplayMetrics;

/**
 * Created by cli on 1/10/17.
 */

public class SampleScreenDisplayHelper {

    /**
     * 获取屏幕比例
     *
     * @param context
     * @return
     */
    public static double getScreenScale(Context context) {
        DisplayMetrics dm = context.getResources().getDisplayMetrics();

        int widthPixels = dm.widthPixels;
        int heightPixels = dm.heightPixels;
        double scale = new Double(heightPixels) / new Double(widthPixels);
        return scale;
    }

}
